You are here: Programming guide > COM SDK fundamentals > About AMM Menu Extension projects

About AMM Menu Extension projects

A project made from the AMM Menu Extension template can be used to add custom commands to the Tools menu of the Meridian EnterprisePowerUser application. These commands will have no relation to the document or folder that is currently selected. They can be used to extend functionality related to the entire vault. An example is the Query Tool created in the AMMMenuSample.vbp sample project.

A menu extension is built like a regular interface extension, but it has some specific features:

An AMM Menu Extension project extends the AfterRegisterExtension event as shown in the following example.

Private Sub AMUIExtension_AfterRegisterExtension( _ 
ByVal Environment As AMEDM.IAMEDMEnvironment, _
ByVal PropertySet As AmOm.IAMPropertySet,  _
ByVal ExtensionRef As AmOm.IAMComRef)
' This assigns your extension the environment class
' You only need to register this extension in your vault to add
' the commands to the Tools menu of the PowerUser
Call AddExtensionToClass(Environment, ExtensionRef, AMEDM_AMENVIRONMENT)
End Sub

The only other code required is extension of the command’s OnExecute event. An example is shown below. These commands are often used to launch external applications.

Private Sub MyToolsMenuCommand_OnExecute( _ 
ByVal CurrentObject As Object,  _
ByVal Host As Object)
On Error GoTo error_handler
Dim dsg As AMUIExtension
Set dsg = Me
Dim dr As AMDocumentRepository
Set dr = dsg.Repository
' Add your code here
' Use the AMDocumentRepository (dr) if you need to do some action in the  vault
Exit Sub error_handler:
MsgBox Err.Description
End Sub

Related information

About the AMMMenuSample sample project

Debugging an interface extension

About the Meridian Enterprisetype libraries


www.bluecieloecm.com